
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>三鑫灯世界 - 提交订单</title>
	<style type="text/css">
		/*.xuan{background: #033AAE;color: #fff;}*/
		.xuan{border: 1px solid red;}
		#bg{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.7; opacity:.70; filter: alpha(opacity=70);}
		#show{display: none; position: absolute; top: 200px; left: 22%; width: 53%; height: 49%; padding: 8px; border: 8px solid #E8E9F7; background-color: white; z-index:1002; overflow: auto;}
		#fitTabletop{display: none;position: absolute; top: 152px; left: 22%;width: 53%;padding: 8px;border: 8px solid #00A7E4; background-color:#00A7E4; z-index:1005;text-align: right;}
		.loading{display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: #fff; z-index:1002; -moz-opacity: 0.6; opacity:.60; filter: alpha(opacity=60);}
		.loading img{position: absolute !important;    top: 0;    right: 0;    bottom: 0;    left: 0;    margin: auto; }
			.hui{color: #666}
		.order-address h2 {
			margin-bottom: 15px;
		}

		.order-confirmOrder h2 {
			line-height: 25px;
			color: #333;
			font-weight: 700;
			font-size: 14px;
		}
		.order-address .list, .order-address .moreAddr {
			width: 1004px;
		}
		.order-address .addr {
			display: inline-block;
			vertical-align: top;
			position: relative;
			width: 237px;
			margin: 0 14px 14px 0;
			color: #666;
			cursor: pointer;
		}
		.order-address .addr .inner {
			z-index: 2;
			position: relative;
			padding: 13px 15px;
			background: url(/shop/public/img/bian2.png) no-repeat;
			overflow: hidden;
		}
		.order-address .addr-active .inner, .order-address .addr-cur .inner {
			background-image: url(/shop/public/img/bian1.png);
		}
		.order-address .addr .addr-hd {
			width: 100%;
			border-bottom: 1px solid #f2f2f2;
			padding: 0 0 5px;
			margin-bottom: 5px;
			line-height: 18px;
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;
		}
		.order-address .addr .addr-hd span {
			display: inline-block;
			vertical-align: top;
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;
		}
		.order-address .addr {
			display: inline-block;
			vertical-align: top;
			position: relative;
			width: 237px;
			margin: 0 14px 14px 0;
			color: #666;
			cursor: pointer;
		}
		#App {
			min-height: 400px;
			padding-bottom: 60px;
			width: 990px;
			margin: auto;
			color: #666;
		}
		.order-address .addr .city {
			font-weight: 700;
			max-width: 64px;
			margin-right: 10px;
		}

		.order-address .addr .addr-bd {
			height: 36px;
			overflow: hidden;
			word-break: break-all;
			word-wrap: break-word;
		}
		.order-address .addr-cur .addr-bd {
			height: 36px;
		}
		.page a {
			color: #c97;
			cursor: pointer;
		}

		a {
			text-decoration: none;
		}
		.order-address .addr-cur .curMarker {
			visibility: visible !important;
		}
		.order-address .addr .curMarker {
			z-index: 3;
			position: absolute;
			background-position: 0 -272px!important;
			width: 28px;
			height: 28px;
			top: 77px;
			right: 0px;
			visibility: hidden;
		}
		.order-address .addr .curMarker {
			background: url(/shop/public/img/tiaomaomao.png) no-repeat;
		}
		.order-address .option {
			height: 33px;
			width: 225px;
			overflow: hidden;
			position: absolute;
			top: 73px;
			left: 6px;
			border: 1px solid #EBEBEB;
			border-top: 0;
			border-bottom: 0;
			border-radius: 0 0 2px 2px;
			background: url(/shop/public/img/T1zRuMXA0aXXb5sY6b-227-7.png) 50% 100% no-repeat;
			z-index: 1;
		}
	</style>

<script src="__PUBLIC__/hytn/js/jquery-1.9.1.min.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script src="__PUBLIC__/hytn/js/jquery.form.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/shop.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/submodal.css" />
<script type="text/javascript" src="__PUBLIC__/js/submodalsource.js"></script>
<link rel="stylesheet" href="__PUBLIC__/css/c.css">
<link rel="stylesheet" href="__PUBLIC__/css/page.css">
</head>
<body>

<!--公共头部2-->
<include file="Public:head2"/>

	<div class="main-wrap" style="width: 1372px;margin: 0 auto;">
		<div class="setting">
			<form id="form1" method="post" action="{:U('Pay/pay')}" autocomplete="off" novalidate="novalidate">
				<div class="main-t">

					<div class="table-wrap chks-table">
					<table>
						<thead>
							<tr class="">
								<th class="tl" width="160">客户名称</th>
								<th class="tl" width="840">收货信息</th>
							</tr>
						</thead>
						<tbody>
							<tr class="receive_tr" id="receive_tr_9837143">
								<td class="tl">
									<span>{:session('user_name')}</span>
								</td>
								<td class="tl">
									<span>收货人：</span>
									<span class="xianame">{$default_address['receiver']}</span>
									<span>联系电话：</span>
									<span class="xiaphone">{$default_address['phone']} </span>
									<span class="xiaaddress">{$default_address['province_name']}{$default_address['city_name']}{$default_address['county_name']}{$default_address['town_name']}{$default_address['detailed_address']}</span>
								</td>
							</tr>			
						</tbody>	
					</table>
				</div>
				
				
				 
	

				<div class="control-box ui-page-tab-con order" style="margin-top:20px">
					<div class="grid-wrap">
						<div class="ui-jqgrid ui-widget ui-widget-content ui-corner-all" id="gbox_grid" dir="ltr" style="width: 100%;">
							<div class="ui-jqgrid-view" role="grid" id="gview_grid" style="width: 100%;">
								<div class="ui-jqgrid-titlebar ui-jqgrid-caption ui-widget-header ui-corner-top ui-helper-clearfix" style="display: none;">
									<a role="link" class="ui-jqgrid-titlebar-close ui-corner-all HeaderButton" title="Toggle Expand Collapse Grid" style="right: 0px;">
										<span class="ui-icon ui-icon-circle-triangle-n"></span>
									</a><span class="ui-jqgrid-title"></span>
								</div>
								<div class="ui-state-default ui-jqgrid-hdiv ui-corner-top" style="width: 100%;"><div class="ui-jqgrid-hbox">
									<table class="ui-jqgrid-htable" style="width: 100%;" role="presentation" aria-labelledby="gbox_grid" cellspacing="0" cellpadding="0" border="0">
										<thead style="width: 100%;">
										<tr class="ui-jqgrid-labels" role="row" style="width: 100%;">
											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable">商品</div>
											</th>

											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable">商品名称</div>
											</th>

											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable">商品规格</div>
											</th>
											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable">数量</div>
											</th>
											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable"><if condition="session('user_vip') eq 1">会员价<else />单价</if></div>
											</th>
											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable">运费</div>
											</th>
											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr install_price" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable">安装方式</div>
											</th>
											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr install_price" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable">安装费</div>
											</th>
											<th id="grid_name" role="columnheader" class="ui-state-default ui-th-column ui-th-ltr" style="width: 10%;">
												<div id="jqgh_grid_name" class="ui-jqgrid-sortable">小计（不含安装费）</div>
											</th>
										</tr>
										</thead>
									</table>
								</div>
								</div>
								<div class="ui-jqgrid-bdiv" style="height: auto; width: 100%;">
									<div style="position:relative;">
										<table id="grid" tabindex="0" cellspacing="0" cellpadding="0" border="0" role="presentation" aria-multiselectable="false" aria-labelledby="gbox_grid" class="ui-jqgrid-btable" style="width: 100%;text-align:center;border-collapse:collapse">
											<tbody>
											<volist name="list" id="li">
												<tr class="ui-widget-content  ui-row-ltr" style="height:104px;width: 100%;border-bottom: 1px solid #d6dee3;">
													<td role="gridcell" style="text-align:center;"><img src="__ROOT__{$li.good_picture}" style="width:100px;height:100px;"></td>
													<td role="gridcell" style="text-align:center;">{$li.good_name}</td>
													<td role="gridcell" style="text-align:center;">{$li.grade}</td>
													<td role="gridcell" style="text-align:center;">{$li.num}</td>
													<td role="gridcell" style="text-align:center;">￥{$li['price']}</td>
													<td role="gridcell" style="text-align:center;color:red;"><b>包邮</b></td>
													<td role="gridcell" style="text-align:center;">
														<if condition="$li.install_type eq 1">
															系统抢单
														<else />
															就近安装
														</if>
													</td>
													<td role="gridcell" class="install_price" style="text-align:center;">
														<if condition="$li.is_install eq 1">
															￥{$li.install_price}
														<else />
															-- --
														</if>
													</td>
													<td role="gridcell" style="text-align:center;">￥{$li['num']*$li[price]}</td>
												</tr>
											</volist>

											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>



					<div class="order-total" style="background:#F5F6F7;min-height: 40px;">
						<input type="hidden" name="dealer_price" value="0"><!--经销商价格-->
						<input type="hidden" name="market_price" value="0"><!--市场价格-->
						<div class="total-r" style="width: 700px;">
							<div class="total-group">
								<div style="width: 40%;float: right; margin-right: 100px;">
									<label class="total-label total-rel-money-label" style="font-size: 16px;"><b>总计</b>：	</label>
									<!-- 商品总价格和订单编号隐藏域 -->
									<input type="hidden" name="count" value="{$count}">
									<input type="hidden" name="on" value="{$order_number}">
									<div class="total red" style="text-align: left;color: red !important;font-size: 20px;">￥<span class="total-rel-money">{$count}</span></div>
								</div>
							</div>
						</div>
					</div>
					<div style="margin-top: 20px;font-size: 14px;">
						<p>安装费收取标准：</p>
						<p>1）射灯、开关等类似小型部件，按个收取</p>
						<p>2）除小型部件的其余商品，按其总价的 <b style="color: red;">{$configInfo['install_price_rebate']*100}%</b> 收取</p>
						<p>3）所有商品的安装费总额未满<b style="color: red;"> {$configInfo['min_install_price']} </b>元，按<b style="color: red;"> {$configInfo['min_install_price']} </b>元收取</p>
					</div>
          </div>				
				</div>

				<div class="func clearfix" style="margin-top: 20px;">
					<div id="zhifu"><span style="font-size: 14px;">选择支付方式 > ></span>
						<button type="button" class="ui-btn addAddress" data-pay="alipay">
							<span class="ui-btn-txt xuan"><img src="__PUBLIC__/img/alipay_logo.png" alt="" width="22px" style="float: left;margin-top: 5px;"><div style="float: left;margin-left: 5px;padding-bottom: 20px;">支付宝支付</div><img src="__PUBLIC__/img/recommend_pay_logo.png" alt="" width="50px" style="margin-left: 5px;margin-top: 5px;"></span>
						</button>

						<button type="button" class="ui-btn addAddress " data-pay="wxpay" style="margin-left: 20px;">
							<span class="ui-btn-txt"><img src="__PUBLIC__/img/wechat_pay_logo.png" alt="" width="25px" style="float: left;margin-top: 5px;"><div style="margin-left: 5px;float: left;">微信支付</div></span>
						</button>
					</div>
				</div>
				
				<div class="control-box btn-submit saveBox">
					<input type="hidden" name="order_id" value="{$order_id}">
					<div class="saveBg"></div>
				    <button class="ui-btn ui-btn-theme save">去支付</button>
				</div>
			</form>

		</div>
	
		</div>
	</div>

	<div id="bg" onclick="hidediv();"></div>
	<p id="fitTabletop" onclick="hidediv();">关闭</p>
	<div id="show">
		<form action="{:U('add_edit_address')}" method="post" class="ajax-form">
			<div class="alert-content">
				<div class="addressManage pt30 pb30">
					<div class="address-edit-con control-box" style="">
						<input type="hidden" name="type" value="1">
						<input type="hidden" id="address_id" name="address_id" value="">
						<div class="control-group">
							<div class="control-label"><a style="color:red;">*</a>&nbsp;收货地址</div>
							<div class="control-input selCity">
								<select  name="province" id="province" style="width:106px;margin-right:10px;" onchange="citys()">
									<option value="" >请选择省份</option>
									<volist name="province_list" id="v">
										<option value="{$v.id}" >{$v.name}</option>
									</volist>
								</select>

								<select  name="city" id="city" style="width:106px;margin-right:10px;" onchange="countys()">
									<option value="" >请选择城市</option>
								</select>

								<select  name="county" id="county" style="width:106px;margin-right:10px;">
									<option value="" >请选择县区</option>
								</select>

								<select  name="town" id="towns" style="width:106px;margin-right:10px;">
									<option value="" >请选择乡镇</option>
								</select>

								<script type="text/javascript">
									addressInit('Select1', 'Select2', 'Select3');
								</script>
							</div>
						</div>

						<div class="control-group">
							<div class="control-label"><a style="color:red;">*</a>&nbsp;详细地址</div>
							<div class="control-input">
								<input type="text" class="ui-input" id="address" name="detailed_address" autocomplete="off">
							</div>
						</div>

						<div class="control-group control-group-line">
							<div class="control-label"><a style="color:red;">*</a>收货人</div>
							<div class="control-input">
								<input type="text" class="ui-input" id="receiver" name="receiver" autocomplete="off">
							</div>

							<div class="control-label control-label-2"><a style="color:red;">*</a>&nbsp;电话</div>
							<div class="control-input">
								<input type="text" class="ui-input" id="phone" name="phone" autocomplete="off">
							</div>
						</div>

						<div class="control-group control-group-line">
							<div class="control-label"><a style="color:red;">*</a>邮编</div>
							<div class="control-input">
								<input type="text" class="ui-input" id="zip_code" name="postcode" autocomplete="off">
							</div>

							<div class="control-label control-label-2">传真</div>
							<div class="control-input">
								<input type="text" class="ui-input" id="fax" name="fax" autocomplete="off">
							</div>
						</div>

						<div class="control-group" style="text-align:center;">
							<div class="control-label"></div>
							<div class="control-input">
								<button class="ui-btn ui-btn-theme" type="submit">保存</button>
							</div>
						</div>

						<input type="hidden" name="addressId" value="0" autocomplete="off">
					</div>
				</div>
			</div>
		</form>
	</div>
	<div class="loading"><img src="__PUBLIC__/img/loading.gif" alt="正在加载..."></div>

	<!--公共底部-->
	<include file="Public:footer"/>

	<!-- 联系客服 -->
	<a target="_blank" style="position: fixed;right: 20px;bottom: 60px;" href="http://wpa.qq.com/msgrd?v=3&uin=2675162351&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:2675162351:51" alt="联系客服" title="联系客服"/></a>
	<a target="_blank" style="position: fixed;right: 20px;bottom: 30px;" href="http://wpa.qq.com/msgrd?v=3&uin=1478709334&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:2675162351:51" alt="联系客服" title="联系客服"/></a>
	<script>
//		$('.loading').show();
		$('.modify').click(function(){
			var aa = $(this);
			var address_id = $(this).parents('.addr').find('input').val();
			if($(this).attr('data-info')){
				$.ajax({
					url:"{:U('del_address')}",
					type:'post',
					data:{address_id:address_id},
					success:function(data){
						aa.parent().parent().parent().remove();
					}
				});
			}else{
				$('.loading').show();
				$.ajax({
					url:"{:U('address_info')}",
					type:'post',
					data:{address_id:address_id},
					success:function(data){
						var data = JSON.parse(data);
						$('#province option').each(function (){
							if($(this).val() == data.province){
								$(this).attr('selected','selected');
							}
						});

						citys();
						$('#city option').each(function (){
							if($(this).val() == data.city){
								$(this).attr('selected','selected');
							}
						});

						countys();
						$('#county option').each(function (){
							if($(this).val() == data.county){
								$(this).attr('selected','selected');
							}
						});

						villages();
						$('#towns option').each(function (){
							if($(this).val() == data.town){
								$(this).attr('selected','selected');
							}
						});
						$('#address').val(data.detailed_address);
						$('#receiver').val(data.receiver);
						$('#zip_code').val(data.postcode);
						$('#phone').val(data.phone);
						$('#fax').val(data.fax);
						$('#address_id').val(data.address_id);
						//展示弹框
						$('.loading').hide()
						document.getElementById("bg").style.display ="block";
						document.getElementById("show").style.display ="block";
						document.getElementById("fitTabletop").style.display ="block";
					}
				});
			}
		});

		function showdiv() {
			$("#bg").attr("onclick","showdiv()");
			document.getElementById("bg").style.display ="block";
			document.getElementById("show").style.display ="block";
			document.getElementById("fitTabletop").style.display ="block";

		}
		function hidediv() {
			document.getElementById("bg").style.display ='none';
			document.getElementById("show").style.display ='none';
			document.getElementById("fitTabletop").style.display ="none";
		}

		$('#zhifu button').click(function(){
			$(this).find('span').addClass('xuan');
			$(this).siblings().find('span').removeClass('xuan');
			var pay_type = $(this).attr('data-pay');
			if(pay_type == 'wxpay'){
				$('#form1').attr('action',"{:U('Pay/wechat')}");
			}else{
				$('#form1').attr('action',"{:U('Pay/pay')}");
			}
		});

		//获取所有的城市
		function citys(){
			//获取被选中的option标签
			var province = $('#province option:selected').val();
			//ajax获取专题下的一级分类
			$.ajax({
				url:"{:U('city')}",
				type:'post',
				async: false,
				data:{province:province},
				success:function(data){
					var city = JSON.parse(data);
					var aa = '<option value="" >请选择城市</option>';
					for(var i=0;i<city.length;i++){
						aa += '<option value="'+city[i].id+'">'+city[i].name+'</option>';
					}
					$('#city').html(aa);
				}
			})
		}

		//获取所有的县区
		function countys(){
			//获取被选中的option标签
			var city = $('#city option:selected').val();
			//ajax获取专题下的一级分类
			$.ajax({
				url:"{:U('county')}",
				type:'post',
				async: false,
				data:{city:city},
				success:function(data){
					var county = JSON.parse(data);
					var aa = '<option value="" >请选择县区</option>';
					for(var i=0;i<county.length;i++){
						aa += '<option value="'+county[i].id+'">'+county[i].name+'</option>';
						$('#county').html(aa);
					}
				}
			})
		}

		//获取所有的县区
		function villages(){
			//获取被选中的option标签
			var county = $('#county option:selected').val();
			//ajax获取专题下的一级分类
			$.ajax({
				url:"{:U('town')}",
				type:'post',
				async: false,
				data:{county:county},
				success:function(data){
					var county = JSON.parse(data);
					var aa = '<option value="" >请选择乡镇</option>';
					for(var i=0;i<county.length;i++){
						aa += '<option value="'+county[i].code+'">'+county[i].name+'</option>';
						$('#towns').html(aa);
					}
				}
			})
		}

		$(".list .zongaddress").click(function(){
			$(this).parent().parent().addClass('addr-cur').siblings().removeClass('addr-cur');
			$('.xianame').text($(this).find('.name').text())
			$('.xiaphone').text($(this).find('.phone').text())
			$('.xiaaddress').text($(this).find('.prov').text()+$(this).find('.city').text()+$(this).find('.dist').text()+$(this).find('.town').text()+$(this).find('.street').text())
			$(this).parent().find('a').text('修改');
			$(this).parent().parent().siblings().find('a').text('删除');
			$(this).parent().find('a').removeClass('red ajax-delete');
			$(this).parent().parent().siblings().find('a').addClass('red ajax-delete');
			$(this).parent().find('a').removeAttr('data-info','确认删除？');
			$(this).parent().parent().siblings().find('a').attr('data-info','确认删除？');
		});




	</script>
	<if condition="$default_address eq null">
		<script>
			$(function () {
				showdiv();
				document.getElementById("fitTabletop").style.display ="none";
				$("#bg").removeAttr("onclick");
			})
		</script>
	</if>
	</body>
</html>